// 公告
import { defHttp } from '/@/utils/http/axios';
import { ErrorMessageMode } from '/#/axios';
enum Api {
  Search = '/risk/search',
  GetMessageList = '/system/message/list', // 获取公告
  ReadOne = '/system/message/read', // 标记消息已读
  ReadAll = '/system/message/read-all', // 标记全部消息已读
}

// 获取消息列表
export function getMessageList(params: any, mode: ErrorMessageMode = 'message') {
  return defHttp.get(
    { url: Api.GetMessageList, params },
    {
      errorMessageMode: mode,
    },
  );
}
// 标记已读
export function readOne(params: any, mode: ErrorMessageMode = 'message') {
  return defHttp.post(
    { url: Api.ReadOne, params },
    {
      errorMessageMode: mode,
    },
  );
}
// 标记全部已读
export function readAll(mode: ErrorMessageMode = 'message') {
  return defHttp.post(
    { url: Api.ReadAll },
    {
      errorMessageMode: mode,
    },
  );
}
